import request from '@/utils/request'

// 获取商品详情
export const findGoods = (id) => {
  return request('/goods', 'get', { id })
}

// 获取商品同类推荐-未传入ID为猜喜欢
export const getRelGoods = ({ id, limit = 16 }) => {
  return request('/goods/relevant', 'get', { id, limit })
}

// 获取商品热销推荐
export const getGoodsHot = ({ id, limit = 3, type }) => {
  return request('/goods/hot', 'get', { id, limit, type })
}

// 获取商品评价信息
export const getCommentInfoByGoods = (id) => {
  return request(`https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate`, 'get')
}

// 筛选条件获取评论列表
export const getCommentListByGoods = (id, params) => {
  return request(`https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate/page`, 'get', params)
}

// 获取商品的specs和skus
export const getSpecsAndSkus = (skuId) => {
  return request(`/goods/sku/${skuId}`, 'get')
}
